package redis

import (
	"fmt"
	"github.com/gomodule/redigo/redis"
)

func LPUSH(key string, value string) {
	c := pool.Get()
	defer c.Close()
	_, err := c.Do("LPUSH", key, value)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer c.Close()
}
func LRANGE(key string, begin int, end int) []string {
	c := pool.Get()
	defer c.Close()
	res, err := redis.Strings(c.Do("LRANGE", key, begin, end))
	if err != nil {
		fmt.Println(err)
	}
	defer c.Close()
	return res
}

func LLEN(key string) int {
	c := pool.Get()
	defer c.Close()
	res, err := redis.Int(c.Do("LLEN", key))
	if err != nil {
		fmt.Println(1)
		fmt.Println(err)
	}
	defer c.Close()
	return res
}
